/*
 *接口编写处...
*如果接口需要做Action的权限验证，请在Action上使用属性
*如: [ApiActionPermission("AssembleWorkOrder",Enums.ActionPermissionOptions.Search)]
 */
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.AspNetCore.Http;
using VOL.Entity.DomainModels;
using VOL.Product.IServices;
using VOL.Product.IRepositories;
using VOL.Product.Repositories;
using VOL.Core.Extensions;
using Microsoft.EntityFrameworkCore;

namespace VOL.Product.Controllers
{
    public partial class AssembleWorkOrderController
    {
        private readonly IAssembleWorkOrderService _service;//访问业务代码
        private readonly IHttpContextAccessor _httpContextAccessor;
        private readonly IAssembleWorkOrderRepository _assembleWorkOrderrepository;

        [ActivatorUtilitiesConstructor]
        public AssembleWorkOrderController(
            IAssembleWorkOrderService service,
            IHttpContextAccessor httpContextAccessor,
            IAssembleWorkOrderRepository assembleWorkOrderRepository
        )
        : base(service)
        {
            _service = service;
            _httpContextAccessor = httpContextAccessor;
            _assembleWorkOrderrepository=assembleWorkOrderRepository;
        }
        [Route("getDetailRows"), HttpGet]
        public async Task<IActionResult> GetDetailRows(int AssembleWorkOrder_Id)
        {
            var rows = await _assembleWorkOrderrepository.FindAsIQueryable(x => x.AssembleWorkOrder_Id == AssembleWorkOrder_Id).ToListAsync();
            return JsonNormal(rows);

        }
    }
}
